﻿using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;

namespace Tiny.Imaging.Filter.BaseFilter
{
    [DataContract]
    public class BaseFilterCollection : List<BaseFilter>
    {
        public string Name { get; set; }

        public int[] Apply(int[] pixels)
        {
            if (Count == 0)
            {
                return pixels;
            }
            return this.Aggregate(pixels, (current, filter) => filter.Apply(current));
        }
    }
}